#ifndef __MULTISELECT_H_
#define __MULTISELECT_H_

#include <common.h>

struct multi_select {
	int fd;
	int (*init)(void);			//初始化函数，返回打开fd文件句柄
	int (*recv_data)(int fd);	//当监听到有数据时调用
	void (*exit)(int fd);		//退出清理函数，如关闭fd等
};

#define MULTI_SELECT_NUM	50

int multi_select_add(struct multi_select *element);
int multi_select_remove(struct multi_select *element);
int multi_select_loop(void);

#endif //__MULTISELECT_H_
